package com.mobileshop.model;

import java.util.HashMap;
import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class YCategory extends Model<YCategory>{
	public final static YCategory dao=new YCategory();
	
	public HashMap<YCategory, List<YCategory>> findMap(){
		List<YCategory> fc=find("select　* from t_product_category where parentcode='N' ");
		HashMap<YCategory, List<YCategory>> categorys=new HashMap<YCategory, List<YCategory>>();
		for(YCategory catagory:fc){
			List<YCategory> cs=find("select *　from t_product_category where parentcode='"+catagory.getStr("code")+"' ");
			categorys.put(catagory, cs);
		}
		return categorys;
	}
 
}
